Add time-based partitioning and archive operations method#12
Merged
jason810496 merged 7 commits intodevelopfrom Dec 28, 2025
Merged
Add time-based partitioning and archive operations method#12jason810496 merged 7 commits intodevelopfrom
jason810496 merged 7 commits intodevelopfrom
Conversation
Copilot
AI
changed the title
[WIP] Add time-based partition option and validation to create_partitioned_queue
Add time-based partitioning, archive operations, and set_vt method
Nov 1, 2025
519f08a to
f551dc2
Compare
…port Co-authored-by: jason810496 <[email protected]>
Co-authored-by: jason810496 <[email protected]>
Co-authored-by: jason810496 <[email protected]>
…revention Co-authored-by: jason810496 <[email protected]>
2c4a647 to
6eb5137
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
jason810496
added a commit
that referenced
this pull request
Dec 28, 2025
* Initial plan * Add read_archive, detach_archive methods and time-based partition support * Fix detach_archive test cleanup to properly handle detached tables * Apply ruff linting and formatting fixes * Add queue name validation to read_archive methods for SQL injection prevention * Remove duplicate set_vt * Remove TODO in README --------- Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements four missing PGMQ features: time-based partition support, archive table operations, and visibility timeout updates.
Changes
Time-based Partitioning
create_partitioned_queue()now acceptsUnion[int, str]for intervals10000) partition bymsg_id'1 day','7 days') partition byenqueued_at_validate_partition_interval()with regex validation for PostgreSQL interval syntaxArchive Operations
read_archive(queue_name)- read single message frompgmq.a_<queue_name>read_archive_batch(queue_name, batch_size)- read multiple messagesdetach_archive(queue_name)- detach archive table from queue usingpgmq.detach_archive()Visibility Timeout Updates
set_vt(queue_name, msg_id, vt)- update message visibility timeout viapgmq.set_vt()Messageobject orNoneTesting
Added 366 tests covering all methods across multiple database drivers (pg8000, psycopg2, psycopg, psycopg2cffi, asyncpg) in both sync and async modes, including validation and error cases.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
install.python-poetry.orgcurl -sSL REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.